//
//  FoutViewController.m
//  UI_豆瓣项目
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "FoutViewController.h"
#import "DataBaseHandle.h"
#import "Fout1ViewController.h"
#import "Fout2ViewController.h"
@interface FoutViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, retain)UITableView *view1;
@property (nonatomic, retain)NSMutableArray *arr;
@property (nonatomic, retain)NSMutableDictionary *dic;
@end

@implementation FoutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view1 = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
    _view1.dataSource = self;
    _view1.delegate = self;
    [self.view addSubview:_view1];
    [_view1 release];
    self.navigationItem.title = @"我的";
    // 重用池
//    [_view1 registerNib:[UINib nibWithNibName:@"FoutViewController" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"cell"];
    [_view1 registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 100;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (indexPath.row == 0) {
        cell.textLabel.text = @"我的活动";
    } else if (indexPath.row == 1) {
        cell.textLabel.text = @"我的电影";
    } else if (indexPath.row == 2) {
        cell.textLabel.text = @"清除数据";
    }
    
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
      self.arr = [[DataBaseHandle sharedDataBaseHandle] selectTable];
        
        
        Fout1ViewController *vc = [[Fout1ViewController alloc] init];
        [self.navigationController pushViewController:vc animated:YES];
        vc.arr1 = self.arr;
    }
    if (indexPath.row == 1) {
        
        
        
        
        
        Fout2ViewController *vc = [[Fout2ViewController alloc] init];
        [self.navigationController pushViewController:vc animated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
